package com.hyx.java.base;

import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
@Builder
@Data
public class BaseResult<T> implements Serializable {

    private static final long serialVersionUID = 4673908632223762301L;

    private String code;

    private String message;

    private T data;
    public static BaseResult success() {
        return BaseResult.builder().code("200").message("成功").build();
    }

    public static <T> BaseResult success(T data){
        return BaseResult.builder().code("200").message("成功").data(data).build();
    }
    public static BaseResult fail(String code, String message) {
        return BaseResult.builder().code(code).message(message).build();
    }
}

